<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%--
  Created by IntelliJ IDEA.
  User: Aini
  Date: 2017/9/15
  Time: 10:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>

<script type="text/javascript" charset="utf-8" src="<%=basePath%>/editor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="<%=basePath%>/editor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="<%=basePath%>/editor/lang/zh-cn/zh-cn.js"></script>

<html>
<head>
    <c:import url="/WEB-INF/jsp/frontend/head.jsp"/>
    <c:import url="/WEB-INF/jsp/frontend/activity/script.jsp"/>
    <link rel="stylesheet" href="<spring:url value="/css/newBlog.css"/>" />
    <link rel="stylesheet" href="<spring:url value="/css/create-activity.css"/>" />


    <title>newActivity</title>
</head>

<body id="body">

<c:import url="/WEB-INF/jsp/frontend/header.jsp" />
<%--<form action="activityRelease" method="post" name="newActivity" id="newActivityForm">--%>
<div class="blog-new-main">
    <div class="blog-new-bar">
        <div class="blog-new-submit">
            发布活动
        </div>
    </div>

    <input id="title" class="blog-new-title" type="text" name="activityName" placeholder="请输入标题"/>
    <div id="c" class="blog-new-editor" style="min-height: 500px"></div>
</div>


<div class="blog-new-button create-activity-btn"><a href="javascript:ShowDiv('Div','mask');">发布</a></div>



<a href="javascript:CloseDiv('Div','mask');" onclick="CloseDiv('Div','mask')"><div id="mask" display="none"></div></a>



<div class="row out-div" id="Div">



    <div class="col-md-12 col-md-6 create-activity-detail">
        <a href="javascript:CloseDiv('Div','mask');" onclick="CloseDiv('Div','mask')"><div class="close"></div></a>
        <div class="create-activity-holder-deatil">发布者信息</div>
        <div name="" class="create-activity-detail-btn" id="submit" ><p>发布</p></div>

        <input type="text" name="release_pubName" id="pubName" placeholder="这里输入姓名" class="create-activity-detail-name create-activity-detail-info"/>
        <input type="text" name="release_pubPhone" id="pubPhone" placeholder="这里输入电话" class="create-activity-detail-tele create-activity-detail-info"/>
        <input type="text" name="release_pubEmail" id="pubEmail" placeholder="这里输入邮箱" class="create-activity-detail-email create-activity-detail-info"/>
        <input type="text" name="release_pubInfo" id="pubInfo" placeholder="这里输入简介" class="create-activity-detail-introduction create-activity-detail-info"/>

        <div class="create-activity-holder-head">
            <span>发布者.jpg</span>
            <div class="pic-logo"></div>
        </div>

        <div class="create-activity-poster">
            <span>点击上传活动海报</span>
            <div class="pic-logo"></div>
        </div>

    </div>
</div>

<%--</form>--%>

<script>
    jQuery("#submit").click(function () {
        jQuery.post("/activityRelease", {
            release_content: window.ue.getContent(),
            release_postName: jQuery("#title").val(),
            release_pubName: jQuery("#pubName").val(),
            release_pubPhone: jQuery("#pubPhone").val(),
            release_pubEmail: jQuery("#pubEmail").val(),
            release_pubInfo: jQuery("#pubInfo").val()
        }, function (response) {
            if (response === "true") {
                alert("success");
                location.href = "<spring:url value="../activityList" />";
            }
        }
        );
    });
    jQuery(function () {
        window.ue = UE.getEditor('c');
    });

    function CloseDiv(Div,mask)
    {
        document.getElementById(Div).style.opacity = "0.5";
        document.getElementById(Div).style.transform = "scale(0,0)";
        document.getElementById(Div).style.transition = "transform 1s";
        document.getElementById(mask).style.display='none';
    }
    function ShowDiv(Div, mask){
        var sHeight=document.documentElement.scrollHeight;
        var sWidth=document.documentElement.scrollWidth;
        var oMask=document.getElementById(mask);
        oMask.style.height=sHeight+"px";
        oMask.style.width=sWidth+"px";
        document.getElementById(mask).style.display = "block";

        document.getElementById(Div).style.opacity = "1";
        document.getElementById(Div).style.transform = "scale(1,1)";
        document.getElementById(Div).style.transition = "transform 1s";

    }
</script>
<script type="text/javascript">
    window.onload = function() {
        //配置
        var config1 = {
            vx: 2,  //小球x轴速度,正为右，负为左
            vy: 2,  //小球y轴速度
            height: 2,  //小球高宽，其实为正方形，所以不宜太大
            width: 2,
            count: 100,      //点个数
            color: "188,188,188",  //点颜色
            stroke: "188,187,187",      //线条颜色
            dist: 8000,    //点吸附距离
            e_dist: 20000,   //鼠标吸附加速距离
            border_radius: 20,
            max_conn: 1   //点到点最大连接数
        };

        var body1 = document.getElementById("body");

        CanvasParticle(config1,body1);

    }
</script>

</body>
</html>